<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%admin_role}}".
 *
 * @property int $id
 * @property string $name
 * @property string|null $desc 介绍
 * @property int|null $created_by
 * @property int|null $updated_by
 * @property int $created_at
 * @property int|null $updated_at
 * @property int|null $deleted_at
 * @property int $max_user_total 最大允许用户数
 * @property int $user_total 用户数量
 * @property int $status 10正常
 */
class AdminRole extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%admin_role}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name', 'created_at', 'max_user_total'], 'required'],
            [['desc', 'created_by', 'updated_by', 'updated_at', 'deleted_at'], 'default'],
            [['created_by', 'updated_by', 'created_at', 'updated_at', 'deleted_at', 'max_user_total', 'user_total', 'status'], 'integer'],
            [['user_total', 'status'], 'trim'],
            [['name'], 'string', 'max' => 100],
            [['desc'], 'string', 'max' => 200],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'name' => Yii::t('app', 'Name'),
            'desc' => Yii::t('app', '介绍'),
            'created_by' => Yii::t('app', 'Created By'),
            'updated_by' => Yii::t('app', 'Updated By'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'deleted_at' => Yii::t('app', 'Deleted At'),
            'max_user_total' => Yii::t('app', '最大允许用户数'),
            'user_total' => Yii::t('app', '用户数量'),
            'status' => Yii::t('app', '10正常'),
        ];
    }
}
